package com.forum.controller.forum;


import com.common.entity.ApiResult;
import com.forum.impl.forum.ForumHomeCarouselServiceImpl;
import com.forum.impl.forum.ForumHomeNewsServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



/**
 * @author Tsing
 */
@RestController
@RequestMapping("forums")
//@CrossOrigin(origins = "*")
@RequiredArgsConstructor(onConstructor =@__(@Autowired))
@Slf4j
public class ForumController {
    public final ForumHomeCarouselServiceImpl forumHomeCarouselService;
    public final ForumHomeNewsServiceImpl forumHomeNewsService;


    // Get Forum Home Carousel List;  获取首页轮播图地址数组
    @GetMapping("/getHomeCarouselList")
    public ApiResult<?> GetHomeCarouselList(){
        return ApiResult.success(forumHomeCarouselService.list());
    }

    // Get Forum Home News ; 获取论坛首页新闻
    @GetMapping("/getHomeNews")
    public ApiResult<?> getHomeNews(){
        return ApiResult.success(forumHomeNewsService.list());
    }
}
